package org.smart4j.framework.helper;

import org.smart4j.framework.ConfigConstant;
import org.smart4j.framework.util.PropUtil;

import java.util.Properties;

/**
 * Created by Cai on 2017/7/26.
 */
public class ConfigHlper {

    private static final Properties CONFIG_PROPS = PropUtil.loadProps(ConfigConstant.CONFIG_FILE);

    /*获取jdbc驱动*/
    public static String getJdbcDriver() {
        return PropUtil.getString(CONFIG_PROPS, ConfigConstant.JDBC_DRIVER);
    }

    /*获取jdbc url*/
    public static String getJdbcUrl() {
        return PropUtil.getString(CONFIG_PROPS, ConfigConstant.JDBC_URL);
    }

    /*获取jdbc username*/
    public static String getJdbcUsername() {
        return PropUtil.getString(CONFIG_PROPS, ConfigConstant.JDBC_USERNAME);
    }

    /*获取jdbc password*/
    public static String getJdbcPassword() {
        return PropUtil.getString(CONFIG_PROPS, ConfigConstant.JDBC_PASSWORD);

    }

    /*获取应用基础包名*/
    public static String getAppBasePackage() {
        return PropUtil.getString(CONFIG_PROPS, ConfigConstant.APP_BASE_PACKAGE);
    }

    /*获取jsp路径*/
    public static String getAppJspPath() {
        return PropUtil.getString(CONFIG_PROPS, ConfigConstant.APP_JSP_PATH, "/WEB-INF/view/");
    }

    /*获取jdbc url*/
    public static String getAppAssetPath() {
        return PropUtil.getString(CONFIG_PROPS, ConfigConstant.APP_ASSET_PATH, "/asset/");
    }


}
